package study.枚举;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author 刘伟涛
 * @Date 2024/3/27 11:29
 **/
public class Demo03 {
    public static void main(String[] args) {
        System.out.println(ParameterTypeEnum.PROCESSING_MODE.getName());
        String name = ParameterTypeEnum.PROCESSING_MODE.getName();
        List<String> collect1 = Arrays.stream(ParameterTypeEnum.values()).map(ParameterTypeEnum::getName).collect(Collectors.toList());
        System.out.println(collect1);

        ParameterEnum[] values = ParameterEnum.values();
        List<String> collect = Arrays.stream(values).filter(v -> v.getType().equals(name)).map(ParameterEnum::getValue).collect(Collectors.toList());
        System.out.println(collect);

        List<String> collect2 = Arrays.stream(values).map(ParameterEnum::getType).distinct().collect(Collectors.toList());
        System.out.println(collect2);
    }
}
